package ai.connectfour.gui;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

import ai.connectfour.Config;

public class ChoiceImagePanel extends JPanel {
	private static final long serialVersionUID = 7494735705946758329L;
	private int col;
	private BufferedImage arrowImage;
	private boolean isMouseOver;

	public ChoiceImagePanel(int col, BufferedImage arrowImage) {
		super();
		this.col = col;
		this.arrowImage = arrowImage;
		isMouseOver = false;
	}
	
	@Override 
	public void paintComponent(Graphics g) {
         super.paintComponent(g);
         g.setColor(Color.GREEN);
         g.drawRect(0, 0, Config.DIMENSION_ROWS*25, Config.DIMENSION_COLS*25);
         if(isMouseOver){
             g.drawImage(arrowImage, 15, 15, Config.DIMENSION_ROWS*10, Config.DIMENSION_COLS*10, null); 
         }
    }

	public int getCol() {
		return col;
	}

	public boolean isMouseOver() {
		return isMouseOver;
	}

	public void setMouseOver(boolean isMouseOver) {
		this.isMouseOver = isMouseOver;
	}
}
